<?php if (!defined('THINK_PATH')) exit(); /*a:5:{s:72:"/home/xlosycom/public_html/application/admin/view/admin/vip_manager.html";i:1523899896;s:45:"./application/index/view/index/head_meta.html";i:1523930539;s:45:"./application/index/view/index/head_link.html";i:1523885480;s:47:"./application/index/view/index/head_script.html";i:1523888906;s:69:"/home/xlosycom/public_html/application/admin/view/admin/navigate.html";i:1523897880;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <base href="<?php echo BASE_PATH; ?>">
    <title>影片添加</title>
    <!--引入头部meta文件 -->
    <meta name="pragma" content="no-cache">
<meta name="cache-control" content="no-cache">
<meta name="expires" content="0">
<meta name="keywords" content="<?php echo \think\Config::get('keywords'); ?>">
<meta name="description" content="<?php echo \think\Config::get('description'); ?>">
<meta http-equiv="Content-Type" content="<?php echo \think\Config::get('Content_Type'); ?>" />
<meta name="robots" content="<?php echo \think\Config::get('robots'); ?>">
<meta name="windows-Target" content="<?php echo \think\Config::get('windows_Target'); ?>">
<meta name="author" content="<?php echo \think\Config::get('author'); ?>">
<meta http-equiv="Content-Language" content="<?php echo \think\Config::get('content_language'); ?>"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <!--引入头部link(css)文件 -->
    <link rel="shortcut icon" href="<?php echo \think\Config::get('page_icon'); ?>">
<link rel="stylesheet" href="public/static/css/base.css?v=<?php echo NOW_TIME; ?>"/>
<link rel="stylesheet" href="public/static/plugs/topNav/css/head.css?v=<?php echo NOW_TIME; ?>" />
<link rel="stylesheet" type="text/css" href="public/static/plugs/bootstrap3.3.7/css/bootstrap.css?v=<?php echo NOW_TIME; ?>">
    <!--引入头部script文件 -->
    <script src="public/static/js/jquery-2.0.0.min.js" type="text/javascript" charset="UTF-8" ></script>
<script src="public/static/js/base/base.js" type="text/javascript" charset="UTF-8" ></script>
<script src="public/static/plugs/bootstrap3.3.7/js/bootstrap.js" type="text/javascript" charset="UTF-8" ></script>
<script type="text/javascript" src="public/static/js/jquery.lazyload.min.js"></script>
<!--IE8只能支持jQuery1.9-->
<!--[if lte IE 8]>
<script src="http://cdn.bootcss.com/jquery/1.9.0/jquery.min.js"></script>
<!-->

    <link rel="stylesheet" href="public/static/plugs/uploadifyphp/uploadify.css" type="text/css">
    <link rel="stylesheet" href="public/static/css/admin/film.css?v=<?php echo NOW_TIME; ?>" type="text/css">
</head>
<body>

<!--内容 START-->
<div class="box">
    <div class="box-left">
        <!--引入导航html文件 -->
        <!--导航-->
<ul class="nav1-ul">
    <li class="nav1-li">
        <h4 class="nav-title"><i class="nav-icon">&nbsp;</i>影片管理</h4>
        <ul class="nav2-ul">
            <a href="<?php echo url('admin/film'); ?>">
                <li class="nav2-li">添加影片</li>
            </a>
            <a href="<?php echo url('admin/film_list'); ?>">
                <li class="nav2-li">所有影片</li>
            </a>
        </ul>
    </li>
    <li class="nav1-li">
        <h4 class="nav-title"><i class="nav-icon">&nbsp;</i>目录管理</h4>
        <ul class="nav2-ul">
            <a href="<?php echo url('admin/catalogs'); ?>">
                <li class="nav2-li">添加目录</li>
            </a>
            <a href="<?php echo url('admin/vip_manager'); ?>">
                <li class="nav2-li">VIP管理</li>
            </a>
        </ul>
    </li>
</ul>
<!--导航-->
    </div>
    <div class="box-right">
        <div style="width:100%; height: auto;overflow:hidden;margin: 0px auto;">
            <h5>可使用的卡号：</h5>
            <table class="table table-bordered table-condensed">
                <thead>
                <tr>
                    <th>加油卡号</th>
                </tr>
                </thead>
                <tbody>
                <?php if(is_array($vip_codes) || $vip_codes instanceof \think\Collection || $vip_codes instanceof \think\Paginator): $i = 0; $__LIST__ = $vip_codes;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): $mod = ($i % 2 );++$i;?>
                    <tr>
                        <td><?php echo $list['code']; ?></td>
                    </tr>
                <?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
            </table>
            <h5>一键生成加油卡号：</h5><a class="btn" id="create_code">生成</a><br/><br/>
            <div>
                <table class="table table-bordered table-condensed">
                    <thead>
                    <tr>
                        <th>加油卡号</th>
                    </tr>
                    </thead>
                    <tbody id="create_code_new">

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--内容 END-->

<script type="text/javascript">
    $(function () {
        $("#create_code").click(function () {
            $.ajax({
                url:"<?php echo url('admin/create_vip_code'); ?>",
                type:"POST",
                dataType:"json",
                data:{
                    num:5
                },
                success:function (data) {
                    if(data.code=="1"){
                        alert("生成加油卡成功");
                        for(var i=0;i<data.data.length;i++){
                            var html = [];
                            html.push("<tr>");
                            html.push("<td>");
                            html.push(data.data[i].code);
                            html.push("</td>");
                            html.push("</tr>");
                            $("#create_code_new").append(html.join(''));
                        }

                    }else{
                        alert("生成加油卡失败！加油卡号不存在");
                    }
                }
            });
        });
    })
</script>
</body>
</html>